package org.opnlp.opnlp2.model;

import java.util.LinkedList;

/**
 * Contains list of documents from Open Parliament's database. This is Singleton pattern implementation.
 * @author Ilija
 * @version 1.0
 */
public class Collection {

    public static Collection instance = null;
    public LinkedList <Document> collectionOfDocuments;
    
    private Collection() {
	collectionOfDocuments = new LinkedList<Document>();
    }
    
    /**
     * Creates and returns Singleton instance if it doesn't exist.
     * @return instance of Collection
     * @version 1.0
     * @author Ilija
     */
    public static Collection instance(){
    	if (instance == null){
		instance = new Collection();
	}
    	return instance;
    }
	
    /**
     * Prints data from all document from collection on Standard output.
     * @version 1.0
     * @author Ilija
     */
    public void printAllDocuments (){
        for (Document d : collectionOfDocuments){
		System.out.println(d.toString());
	}
    }
    
}
